#include <sstream>

#include "common/api/client.h"

#include "common/config/config.h"

#include "common/elements/element_type.hpp"

#include "common/log/log.h"

#include "common/more/uuid.h"

#include "stem.h"

Stem::Stem()
{
    logSplash();
    std::stringstream stream;
    stream << CONFIG.network.apiHost << ":" << CONFIG.network.apiPort;
    m_datenaroGate = std::make_shared<Api::Client>(stream.str());
    m_uiController = std::make_shared<Ui::UiController>(m_datenaroGate);
}

int Stem::run()
{
    m_uiController->run();
    return EXIT_SUCCESS;
}

void Stem::logSplash() const
{
    LOG_INFO << "Запуск системы";
}
